package com.alpaak.common.utils;

import com.alpaak.common.adapter.ConfSetPropertyHolder;
import org.apache.log4j.Logger;


public class IntelligentBedBUtils { 
  private static Logger logger = Logger.getLogger(IntelligentBedBUtils.class);
  static String BED_B_URL = ConfSetPropertyHolder.getProperty("bed_a_url");

  public  static String  getdevicehistorydata(String deviceid,String begindate,String enddate) throws Exception{
	  String  historydataUrl=BED_B_URL+"/zncapi/getdevicehistorydata?deviceid="+deviceid+"&begindate="+begindate+"&enddate="+enddate;
	  logger.info("url:"+historydataUrl);
	  String  result=HttpClientUtil.httpGetRequest(historydataUrl);
	  logger.info("url:"+historydataUrl+"result:"+result);
	  return result;
  }
  
  
  
 
  
  
  public  static String  checkdeviceid(String deviceid) throws Exception{
	  String  checkdeviceidUrl=BED_B_URL+"/zncapi/checkdevice?deviceid="+deviceid;
	  logger.info("url:"+checkdeviceidUrl);
	  String   result=HttpClientUtil.httpGetRequest(checkdeviceidUrl);
	  logger.info("url:"+checkdeviceidUrl+"result:"+result);
	  return result;
  }
}
